<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class DropCreateContentTemplateDetails extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('content_template_details');
        Schema::create('content_template_details', function (Blueprint $table) {
            $table->increments('id');
            // 模板类型模板
            $table->integer('content_template_id')->index();
            // 内容模板编号
            $table->string('template_details_no',100);
            $table->string('name', 100);
            $table->string('title', 100)->nullable();
            $table->string('subtitle', 100)->nullable();
            $table->text('short_desc', 100)->nullable();
            // 开始时间
            $table->timestamp('start_at')->nullable();
            // 结束时间
            $table->timestamp('end_at')->nullable();
            // 上线时间
            $table->timestamp('online_at')->nullable();
            // 下线时间
            $table->timestamp('offline_at')->nullable();
            // 发布时间
            $table->timestamp('publish_at')->nullable();
            $table->tinyInteger('online_status')->default(0);
            $table->tinyInteger('publish_status')->default(0);
            $table->tinyInteger('publish_down_status')->default(1);
            $table->tinyInteger('moderate_status')->default(0);
            $table->Integer('user_id')->default(1); 
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('content_template_details');
    }
}
